<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../static/layui/css/layui.css"/>
    <link rel="stylesheet" href="../static/css/public.css">
</head>

<body style="background-image: url('../static/images/bg3.jpg')">

<div id="gb" style="padding-bottom: 100px;">
    <form class="layui-form" action="">
        <input type="hidden" id="us" th:value="${session.user}">
        <input type="hidden" id="imgs" th:if="${session.user!=null}" th:value="${session.user.avatarUrl}">
        <input type="hidden" name="id" th:if="${session.user!=null}" th:value="${session.user.id}">
        <div class="registerbox-title">用户注册中心</div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户账号</label>
            <div class="layui-input-inline">
                <input type="text" name="username" required lay-verify="required" placeholder="请输入账号" autocomplete="off"
                       th:value="${session.user!=null?session.user.username:''}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="pwd" placeholder="请输入密码" autocomplete="off"
                       th:value="${session.user!=null?session.user.password:''}" class="layui-input" id="pass1">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-inline">
                <input type="password" name="passwords" required lay-verify="pwd" placeholder="请再次输入密码"
                       th:value="${session.user!=null?session.user.password:''}" autocomplete="off" class="layui-input" id="pass2">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block" th:if="${session.user==null}">
                <input type="radio" name="sex" value="0" title="男" checked>
                <input type="radio" name="sex" value="1" title="女">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="name" required lay-verify="name" placeholder="请输入您的姓名"
                       th:value="${session.user!=null?session.user.name:''}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-upload" style="padding-left: 20px;">
                <button type="button" class="layui-btn" id="test1">上传图片</button>
                <div class="layui-upload-list">
                    <!--<img class="layui-upload-img" th:src="${session.user!=null?session.user.avatarUrl:'/images/mr.png'}"-->
                    <img src="../static/images/touxiang.jpg"
                         width="100px" height="100px">
                    <p id="demoText"></p>
                </div>
                <!--上传返回的图片地址-->
                <input type="hidden" name="avatarUrl" id="uploadImg" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 20px;">
                <a style="text-decoration:underline	;padding-right: 20px;color: #2badce" href="/">回首页</a>
                <button class="layui-btn" lay-submit lay-filter="formDemo">注册</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
</body>

<script src="http://ajax.useso.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<!--<script type="text/javascript" src="../../layui/layui.all.js"></script>-->
<script type="text/javascript" src="../static/layui/layui.js"></script>
<script type="text/javascript" src="../static/js/register.js"></script>
</html>